Android ListView の高さ調節
Android ListView の高さ調節
行の高さ調節, onCreateViewHolderはこんな感じ。
View.layoutParams.height kotlinなので、元のJavaだと getHeight
Listの高さの1/4を rowの高さにする RecyclerViewの例
code: adjustRowHeight.kt
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ScrapListViewHolder {
val view = mLayoutInflater.inflate(R.layout.row_scrap, parent, false)
view.layoutParams.height = parent.getMeasuredHeight() / 4
val holder = ScrapListAdapter.ScrapListViewHolder(view)
return holder
}